/*
 * Copyright © 2017 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
*/

@import '../RulesEngineWrapper.scss';
@import '../../../styles/variables.scss';

$loading_bar_color: white;
$rule-book-metadata-color: #999999;
$header-bg-color: #f5f5f5;

.rule-book-details {
  padding: $tab_header_height;
  height: 100%;

  &.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    a {
      &:not([href]),
      &:not([tabindex]) {
        color: $brand-primary;
        cursor: pointer;
        text-decoration: none;
      }
    }
  }
  &.loading {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .rule-book-name-header {
    .rule-book-name-version {
      max-width: 100%;
      line-height: 1;
    }

    .btn {
      padding-top: 5px;
      padding-bottom: 5px;

      .loading-bar {
        height: 18px;
        vertical-align: top;
        rect {
          fill: $loading_bar_color;
        }
      }
    }
    h3 {
      font-weight: bolder;
      margin: 0;
      line-height: 1;
    }
  }

  .rules-container {
    min-height: 300px;
    padding: 10px;
    margin-left: -10px;
    margin-right: -10px;

  }
}

.rule-book-create {
  padding: 40px;

  .create-metadata-container {
    .rule-book-name-header {
      display: block;

      .rule-book-name {
        margin: -10px 0 0 0;
      }

      .rule-book-version {
        margin-left: 5px;
      }
    }

    .rule-book-description {
      margin-bottom: 15px;
    }

    .form-control {
      margin: 10px 0;
    }
    .button-container {
      display: flex;
      align-items: center;

      button {
        color: $brand-primary;
      }

      .create-next {
        margin-left: 20px;
      }
    }
  }
}

.rule-book-name-header {
  height: 100px;
  background-color: $header-bg-color;
  margin: -40px -40px 0 -40px;
  padding: 40px 40px 0 40px;
  display: flex;
  justify-content: space-between;

  .rule-book-name {
    font-size: 18px;
    word-break: break-all;
    word-wrap: break-word;
  }

  .rule-book-version {
    font-size: 11px;
    margin-top: 2px;
    font-weight: bold;
    color: $rule-book-metadata-color;
  }
}

.rule-book-metadata,
.rule-book-description {
  font-size: 14px;
  color: $rule-book-metadata-color;
  word-break: break-all;
}

.rule-book-metadata {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin: 10px 0 20px;

  .rv-xy-plot.rv-radial-chart {
    margin-top: -10px;
  }
}
